<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<js href="__PUBLIC__/Js/Jquery/jquery-1.4.4.min.js" />
</head>
<body>
<script type="text/javascript">
   function disp(res){ 
	   $(res).hide();
   }
   
   function point(a,b){
	   if(b>=a){
			 var left=($(window).width()-$('.dialog').width())/2;
			 var top=($(window).height()-$('.dialog').height())/2;
			 $('.dialog').fadeIn().css({'top':top,'left':left});
			 var top=parseInt($('.dialog').css('top'))-$(document).scrollTop();
			 var left=parseInt($('.dialog').css('left'))-$(document).scrollTop();
			 $(window).scroll(function(){
			 $('.dialog').fadeIn().css({'top':$(document).scrollTop()+top,'left':$(document).scrollLeft()+left});
			 });
		}
		 if(b<a){
			 var left=($(window).width()-$('.dialog_fail').width())/2;
			 var top=($(window).height()-$('.dialog_fail').height())/2;
			 $('.dialog_fail').fadeIn().css({'top':top,'left':left});
			 var top=parseInt($('.dialog_fail').css('top'))-$(document).scrollTop();
			 var left=parseInt($('.dialog_fail').css('left'))-$(document).scrollTop();
			 $(window).scroll(function(){
			 $('.dialog_fail').fadeIn().css({'top':$(document).scrollTop()+top,'left':$(document).scrollLeft()+left});
			 });
	   }
   }
 $(document).ready(function(){
    $('#but_no').click(function(){
				 var left=($(window).width()-$('.dialog_log').width())/2;
				 var top=($(window).height()-$('.dialog_log').height())/2;
				 $('.dialog_log').fadeIn().css({'top':top,'left':left});
				 var top=parseInt($('.dialog_log').css('top'))-$(document).scrollTop();
				 var left=parseInt($('.dialog_log').css('left'))-$(document).scrollTop();
				 $(window).scroll(function(){
				 $('.dialog_log').fadeIn().css({'top':$(document).scrollTop()+top,'left':$(document).scrollLeft()+left});
				 });
	    });

 $('#certain').click(function(){
   	  $('.dialog_log').hide();
   	  window.location.href="{:U('User/login')}";
     });
	 
	 $('#down').click(function(){
		 $('.dialog').hide();
		 $('#fom').submit();
	 });

})
</script>
<eq name='is_login' value='1'>
<input type='button' id='but' value='下载' onclick="point({$info['downscore']},{$prescore})"/> <else/>
 <input type='button' id='but_no' value='下载'/>
</eq>
<div class='dialog' style='width:300px;height:300px;border:1px solid red;display:none;position:fixed'>
<table align='center'>
   <tr height='30px' ><td width='300px'><span >文档下载</span><span style='float:right;cursor:pointer' id='X' onclick="disp('.dialog');">×</span></td></tr>
   <tr height='40px'><td>{$info.title}</td></tr>
   <tr height='30px'><td>下载所需积分:{$info.downscore}</td></tr>
   <tr height='30px'><td>您剩余积分:{$prescore}</td></tr>
   <tr height='50px'><td>温馨提示:XXX</td></tr>
   <tr height='50px'><td> 
           <form method='post' id='fom' action="{:U('Article/articledownload')}">
           <input type='hidden' name='title' value='{$info.title}'/>
           <input type='hidden' name='url' value='{$info.url}'/>
          <input type='hidden' name='score' value='{$info.downscore}'/>
          <input type='hidden' name='code' value='{$info.code}'/>
          <input type='hidden' name='aid' value='{$info.aid}'/>
          <input type='button' id='down' value='下载'/>
          <input type='button' id='cancel' value='取消' onclick="disp('.dialog');"/>
          </form>
   </td></tr>
 </table>
</div>

<div class='dialog_fail' style='width:300px;height:300px;border:1px solid red;display:none;position:fixed'>
<table align='center'>
   <tr height='30px' ><td width='300px'><span >文档下载</span><span style='float:right;cursor:pointer' id='X' onclick="disp('.dialog_fail');">×</span></td></tr>
   <tr height='40px'><td>{$info.title}</td></tr>
   <tr height='30px'><td>下载所需积分:{$info.downscore}</td></tr>
   <tr height='30px'><td>您当前的积分是{$prescore}，不足以支付下载</td></tr>
   <tr height='50px'><td>温馨提示:XXX</td></tr>
   <tr height='50px'><td> 
           <form>
           <input type='hidden' name='title' value='{$info.title}'/>
           <input type='hidden' name='url' value='{$info.url}'/>
          <input type='hidden' name='score' value='{$info.downscore}'/>
          <input type='hidden' name='code' value='{$info.code}'/>
          <input type='hidden' name='aid' value='{$info.aid}'/>
          <input type='button' id='free' value='收藏此文档（免费）'/>
          <input type='button' id='cancel' value='关闭' onclick="disp('.dialog_fail');"/>
          </form>
   </td></tr>
 </table>
</div>
<div class='dialog_log' style='width:300px;height:300px;border:1px solid red;display:none;position:fixed'>
<table align='center'>
   <tr height='30px' ><td width='300px'><span >先登录</span><span style='float:right;cursor:pointer' id='X' onclick="disp('.dialog_log');">×</span></td></tr>
    <tr height='50px'><td> 
           <form>
        
          <input type='button' id='certain' value='确定'/>
          <input type='button' id='cancel' value='关闭' onclick="disp('.dialog_log');"/>
          </form>
   </td></tr>
 </table>
</div>
</body>
</html>